package com.zhouzi.zhaoyang.adapter.rvadapter;

import android.graphics.Color;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhouzi.zhaoyang.R;
import com.zhouzi.zhaoyang.bean.GetOrderListBean2;
import com.zhouzi.zhaoyang.util.Calculator;

import java.util.List;

public class TransactionQueryAdapter  extends BaseQuickAdapter<GetOrderListBean2.RecordsBean,BaseViewHolder> {

    public TransactionQueryAdapter(int layoutResId, @Nullable List data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, GetOrderListBean2.RecordsBean item) {
        helper.setText(R.id.tvNo,item.getOutTradeNo());
        helper.setText(R.id.tvMoney, Calculator.fen2Yuan(item.getMemberTotalFee())+"元");
        int payType = item.getOrderStatus();
        switch (payType){
            case 1:
                helper.setText(R.id.tvClass,"已付款");
                helper.setTextColor(R.id.tvClass, Color.parseColor("#1AAD19"));

                break;
            case 3:
                helper.setText(R.id.tvClass,"退款");
                helper.setTextColor(R.id.tvClass, Color.RED);
                break;
                default:

        }
        helper.addOnClickListener(R.id.tvPrint);

    }
}
